<%@page import="com.wodwl.entity.Blog"%>
<%@page import="com.wodwl.entity.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<%@include file="../templete/header.jsp" %>
	<script type="text/javascript" src="../../static/ckeditor/ckeditor.js"></script>
	<script type="text/javascript" src="../../static/js/jquery-1.7.min.js"></script>
	<script type="text/javascript">
	$(document).ready(function() {   
		$("#json").click(
			function(){
				$.ajax({       
					type: "POST",   
					url: "/blog/json.do", 
					contentType: "application/json; charset=utf-8", 
					dataType: "json",       
					data: "{}",  
					success: function(res) { alert(res.name); }   
					});
				});	
			}
		);
	
	
	
		function jsonTest(){
			
			
			/*
			var xmlhttp;
			if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
				xmlhttp = new XMLHttpRequest();
			} else {// code for IE6, IE5
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			xmlhttp.open("GET", "/user/check_user.do?username="+username, false);
			xmlhttp.send();
			var result = xmlhttp.responseText;
			
			$(document).ready(function() {   
				$.ajax({       
					type: "POST",   
					url: "/SampleRestService", 
					contentType: "application/json; charset=utf-8", 
					dataType: "json",       
					data: "{}",  
					success: function(res) {    
					$('#Results').append(CreateTableView(res)).fadeIn();  
				}    });});
			*/
		}
	</script>
</head>
<body >
<%pageContext.setAttribute("linkType","2");%>
<%@include file="../templete/user_info.jsp"  %>
	<%
		Blog blog = (Blog) request.getAttribute("blog");
	%>



		<div class="conR">
			<div class="conR-hd">
				<h3><%=blog.getTitle()%></h3>
			</div>

			<div class="oauth-sum-list">
				<div class="oauth-sum-listinfo">
				<input type="button" id="json" name="json" onclick="jsonTest()" value="json test">;
					<table>
						<tbody>
							<tr>
								<td>
									<p>
										作者：<a href="/user/info_display.do?username=<%=user.getUsername()%>&request_username=<%=blog.getUsername()%>"><font color="blue"><%=blog.getUsername()%></font></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=sdf.format(blog.getCreate_time())%>&nbsp;&nbsp;
										<%
											if (blog.getUsername().equals(user.getUsername())) {
										%>
										<a href="/blog/blog_editor1.do?username=<%=user.getUsername()%>&bid=<%=blog.getBid()%>"><font color="green">编辑</font></a>
										<%
											}
										%>

									</p> <br /> <br /> <%=blog.getContent()%>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>

		<jsp:include page="../templete/footer.jsp"></jsp:include>
</body>
</html>